package cn.tedu.oop;
/**多态回顾
 * */
public class TestDemo {
    public static void main(String[] args) {
        Animai a=new Animai();
        Cat c=new Cat();
        Dog d=new Dog();
        a.eat();
        c.eat();
        d.eat();
        c.jump();
        d.run();

        Animai a2=new Cat();
        Animai a3=new Dog();
        a2.eat();
        a3.eat();
    }

}
class Animai{
    public void eat(){
        System.out.println("吃啥都行");
    }
}
class Cat extends Animai{
    @Override
    public void eat(){
        System.out.println("小猫爱吃小鱼干");
    }
    public void jump(){
        System.out.println("小猫跳得老高了");
    }
}
class Dog extends Animai{
    @Override
    public void eat(){
        System.out.println("小狗爱吃肉骨头");
    }
    public void run(){
        System.out.println("小狗跑得快");
    }
}